<!DOCTYPE html>
<html>
<head>
	<title>施工项目表</title>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
	<link rel="stylesheet" href="../../css/bootstrap.min.css">
	<link rel="stylesheet" href="../../css/font-awesome.min.css">
	<link rel="stylesheet" href="../../plugins/jqgrid/ui.jqgrid-bootstrap.css">
	<link rel="stylesheet" href="../../plugins/ztree/css/metroStyle/metroStyle.css">
	<link rel="stylesheet" href="../../css/main.css">
	<script src="../../libs/jquery.min.js"></script>
	<script src="../../plugins/layer/layer.js"></script>
	<script src="../../libs/bootstrap.min.js"></script>
	<script src="../../libs/vue.min.js"></script>
	<script src="../../plugins/jqgrid/grid.locale-cn.js"></script>
	<script src="../../plugins/jqgrid/jquery.jqGrid.min.js"></script>
	<script src="../../plugins/ztree/jquery.ztree.all.min.js"></script>
	<script src="../../js/common.js"></script>
	<!--<script src="../../js/modules/csg/snap.svg-min.js"></script>-->
	<!--<script src="../../js/modules/csg/TestDXF_cpbase.js"></script>-->
</head>
<style type="text/css">
	/*.col-sm-10.sgd_3 {
		width: 370px;
		height: 150px;
		border-style: solid;
	}
	.col-sm-10.cyr_2 {
		width: 370px;
		height: 150px;
		border-style: solid;
	}*/
	.col-sm-10.pror {
		float: left;
		width: 15%;
		padding-left: -130px;
		margin-left: -20px;
	}
	.col-sm-2.control-label.prol {
		/* float: left; */
		width: 10%;
		padding-top: 5px;
	}
	#outer-box {
		height: 100%;
		padding-right: 300px;
	}

	#container {
		margin-left:600px;
		margin-top:50px;
		width:700px;
		height:400px;
	}

	#panel {
		position: absolute;
		top: 50px;
		bottom: 0;
		right: 0;
		height: 400px;
		overflow: auto;
		width: 300px;

		border-left: 1px solid #eaeaea;
		background: #fff;
	}

	#searchBar {
		height: 30px;
		background: #ccc;
	}

	#searchInput {
		width: 100%;
		height: 30px;
		line-height: 30%;
		-webkit-box-sizing: border-box;
		box-sizing: border-box;
		border: none;
		border-bottom: 1px solid #ccc;
		padding: 0 5px;
	}

	#searchResults {
		overflow: auto;
		height: calc(400px - 30px);
	}

	.amap_lib_placeSearch,
	.amap-ui-poi-picker-sugg-container {
		border: none!important;
	}

	.amap_lib_placeSearch .poibox.highlight {
		background-color: #CAE1FF;
	}

	.poi-more {
		display: none!important;
	}



</style>
<body>
<div id="rrapp" v-cloak>
	<div v-show="showList">
		<div class="grid-btn">

			<div class="form-group">
				<div class="col-sm-2 control-label prol">项目类型</div>
				<!--<span class="col-sm-2 control-label">项目类型</span>-->
				<div class="col-sm-10 pror">
					<select class="form-control" v-model="q.pBType"  placeholder="项目类型"   >
						<option value="">
							全部</option>
						<option v-for="d in progect_type" :value="d.dKey">
							{{d.dValue}}</option>
					</select>
				</div>

			</div>

			<!--<div class="form-group">
				<div class="col-sm-2 control-label">储备状态</div>
				<div class="col-sm-10">
					<select class="form-control" v-model="q.pBHive"  placeholder="储备状态">
						<option value="">
							全部</option>
						<option v-for="d in project_hivetype" :value="d.dKey">
							{{d.dValue}}</option>
					</select>
				</div>

			</div>-->
			<div class="form-group">
				<div class="col-sm-2 control-label prol">项目状态</div>
				<!--<span class="col-sm-2 control-label">项目状态</span>-->
				<div class="col-sm-10 pror">
					<select class="form-control" v-model="q.pBState"  placeholder="项目状态">
						<option value="">
							全部</option>
						<option v-for="d in project_state" :value="d.dKey">
							{{d.dValue}}</option>
					</select>
				</div>

			</div>


			<div class="form-group">
				<div class="col-sm-2 control-label prol">项目名称</div>
				<div class="col-sm-10 pror">
					<input type="text"  class="form-control" v-model="q.pBName" @keyup.enter="query" placeholder="项目名称">
				</div>
			</div>

			<a class="btn btn-default" @click="reload">查询</a>
			<a v-if="hasPermission('csg:cpbase:save')" class="btn btn-primary" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>
			<a v-if="hasPermission('csg:cpbase:update')" class="btn btn-primary" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
			<a v-if="hasPermission('csg:cpbase:delete')" class="btn btn-primary" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
		</div>

		<!--<div class="new_mainpanle" style="overflow:auto" >
			<div class="" id="parent_svg" style="height:1000px; ">
				<svg id="singleLine" width="1000" height="400" version="1.1"
					 xmlns="http://www.w3.org/2000/svg">
				</svg>
			</div>
		</div>
		<form id="dxfform" target="_blank" action="/csg/cpbase/expDxfFile" method="post">
			<input type="hidden" name="svgStr" id="svgStr">
			<input type="hidden" name="dxf_file_name" id="dxf_file_name">
		</form>-->
		<table id="jqGrid"></table>
		<div id="jqGridPager"></div>
	</div>

	<div v-show="!showList" class="panel panel-default">
		<div class="panel-heading">{{title}}</div>


		<form class="form-horizontal">

			<div class="form-group">
				<div class="col-sm-2 control-label">项目类别</div>
				<div class="col-sm-10">
					<!--<input type="text" class="form-control" v-model="aPBase.pBType" placeholder="项目类别   数据字典  progect_type"/>-->
					<select class="form-control" v-model="cPBase.pBType">
						<option v-for="f in progect_type" :value="f.dKey">
							{{f.dValue}}</option>
					</select>
				</div>
			</div>

			<div class="form-group">
				<div class="col-sm-2 control-label">业务类型</div>
				<div class="col-sm-10">
					<!--<input type="text" class="form-control" v-model="aPBase.pBCategory" placeholder="业务类型 数据字典 category_type"/>-->
					<select class="form-control" v-model="cPBase.pBCategory">
						<option v-for="f in category_type" :value="f.dKey">
							{{f.dValue}}</option>
					</select>
				</div>
			</div>


			<div class="form-group">
				<div class="col-sm-2 control-label">项目状态</div>
				<div class="col-sm-10">
					<!--<input type="text" class="form-control" v-model="aPBase.pBState" placeholder="项目状态  数据字典 project_state (踏勘、估算调整、归档)"/>-->
					<select class="form-control" v-model="cPBase.pBState">
						<option v-for="f in project_state" :value="f.dKey">
							{{f.dValue}}</option>
					</select>
				</div>
			</div>
			<div class="form-group">
				<div class="col-sm-2 control-label">项目名称</div>
				<div class="col-sm-10">
					<input type="text" class="form-control" v-model="cPBase.pBName" placeholder="项目名称"/>
				</div>
			</div>
			<div class="form-group">
				<div class="col-sm-2 control-label">项目地址</div>
				<div class="col-sm-10">
					<input type="text" class="form-control" v-model="cPBase.pBAddress" placeholder="项目地址"/>
				</div>
			</div>

			<div class="form-group">
				<div class="col-sm-2 control-label">最高电压等级</div>
				<div class="col-sm-10">
					<!--<input type="text" class="form-control" v-model="aPBase.pBVoltage" placeholder="最高电压等 数据字典 voltage_type(10kV,380V,220V)"/>-->
					<select class="form-control" v-model="cPBase.pBVoltage">
						<option v-for="f in voltage_type" :value="f.dKey">
							{{f.dValue}}</option>
					</select>
				</div>
			</div>

			<div class="form-group">
				<div class="col-sm-2 control-label">是否作图</div>
				<div class="col-sm-10">
					<!--<input type="text" class="form-control" v-model="aPBase.pBVoltage" placeholder="最高电压等 数据字典 voltage_type(10kV,380V,220V)"/>-->
					<select class="form-control" v-model="cPBase.isDraw">
						<option v-for="f in status" :value="f">
							{{f}}
						</option>
					</select>
				</div>
			</div>

			<!--<result property="" column="is_draw"/>-->


			<div class="form-group">
				<div class="col-sm-2 control-label">施工参与人</div>
				<div class="col-sm-10">

					<div class="left" style="width: 160px;height: 194px;font-size: 16px;float: left;">
						<!--选择施工队-->
						<select class="form-control"  id="pArentname" onchange="getall_user()">
							<option value=''>---请选择---</option>

							<option v-for="f in construction" :value="f.deptId">
								{{f.name}}
							</option>

						</select>

						<!--施工队下辖人员-->
						<select name="input" size="10" multiple="multiple" id="staff" style="width:160px; height: 160px; font-size:16px">
							<!--<option value=''>---请选择---</option>-->

						</select>
					</div>

					<div class="center" style="float: left;margin-top: 70px;">
						<p>
							<input type="button" name="Submit" value="增  加" onclick="addIt()"/>
						</p>
						<p>
							<input type="button" name="Submit2" value="删  除" onclick="deleteIt()"/>
						</p>
					</div>

					<div class="reight" style="width: 140px;height: 194px;font-size: 16px;float: left;">
						<select class="form-control" v-model="cPBase.pBReckonid" name="output" size="10"
								multiple="multiple" id="Preservation" style="width: 160px;height: 194px;font-size: 16px;">
							<option v-for="f in def" :value="f.userId">
								{{f.username}}</option>
						</select>
					</div>

				</div>
			</div>




			<div class="form-group">
				<div class="col-sm-2 control-label cyr_1">项目参与人</div>

				<!--<input type="text" class="form-control" v-model="aPBase.pBCollectid" placeholder="参与人 "/>-->
				<!-- 施工参与人也可以多选 -->
				<div class="col-sm-10 cyr_2">
					<label v-for="r in userall" class="checkbox-inline">
						<input type="checkbox" :value="r.userId" v-model="cPBase.pBCollectid">{{r.username}}
					</label>
					<!--<input type="checkbox" >b-->
				</div>

			</div>


			<div class="form-group">
				<div class="col-sm-2 control-label"></div>
				<input type="button" class="btn btn-primary" @click="saveOrUpdate"  value="确定"/>
				&nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
			</div>

		</form>










		<!--<form class="form-horizontal">
											<div class="form-group">
			   	<div class="col-sm-2 control-label">所属批次</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control" v-model="cPBase.bGuid" placeholder="所属批次"/>
			    </div>
			</div>
									<div class="form-group">
			   	<div class="col-sm-2 control-label">业务类型</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control" v-model="cPBase.pBCategory" placeholder="业务类型"/>
			    </div>
			</div>
									<div class="form-group">
			   	<div class="col-sm-2 control-label">项目类别</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control" v-model="cPBase.pBType" placeholder="项目类别"/>
			    </div>
			</div>
									<div class="form-group">
			   	<div class="col-sm-2 control-label">储备状态</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control" v-model="cPBase.pBHive" placeholder="储备状态"/>
			    </div>
			</div>
									<div class="form-group">
			   	<div class="col-sm-2 control-label">项目状态</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control" v-model="cPBase.pBState" placeholder="项目状态"/>
			    </div>
			</div>
									<div class="form-group">
			   	<div class="col-sm-2 control-label">项目名称</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control" v-model="cPBase.pBName" placeholder="项目名称"/>
			    </div>
			</div>
									<div class="form-group">
			   	<div class="col-sm-2 control-label">项目地址</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control" v-model="cPBase.pBAddress" placeholder="项目地址"/>
			    </div>
			</div>
									<div class="form-group">
			   	<div class="col-sm-2 control-label">项目经度</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control" v-model="cPBase.pBLongitude" placeholder="项目经度"/>
			    </div>
			</div>
									<div class="form-group">
			   	<div class="col-sm-2 control-label">项目纬度</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control" v-model="cPBase.pBLatitude" placeholder="项目纬度"/>
			    </div>
			</div>
									<div class="form-group">
			   	<div class="col-sm-2 control-label">项目单位</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control" v-model="cPBase.pBOrgid" placeholder="项目单位"/>
			    </div>
			</div>
									<div class="form-group">
			   	<div class="col-sm-2 control-label">所属申请书</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control" v-model="cPBase.aGuid" placeholder="所属申请书"/>
			    </div>
			</div>
									<div class="form-group">
			   	<div class="col-sm-2 control-label">所属预算标准</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control" v-model="cPBase.sGuid" placeholder="所属预算标准"/>
			    </div>
			</div>
									<div class="form-group">
			   	<div class="col-sm-2 control-label">最高电压等</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control" v-model="cPBase.pBVoltage" placeholder="最高电压等"/>
			    </div>
			</div>
									<div class="form-group">
			   	<div class="col-sm-2 control-label">踏勘人</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control" v-model="cPBase.pBCollectid" placeholder="踏勘人"/>
			    </div>
			</div>
									<div class="form-group">
			   	<div class="col-sm-2 control-label">估算人</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control" v-model="cPBase.pBReckonid" placeholder="估算人"/>
			    </div>
			</div>
									<div class="form-group">
			   	<div class="col-sm-2 control-label">创建时间</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control" v-model="cPBase.pBAddtime" placeholder="创建时间"/>
			    </div>
			</div>
									<div class="form-group">
			   	<div class="col-sm-2 control-label">项目申请书名称</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control" v-model="cPBase.pBBookname" placeholder="项目申请书名称"/>
			    </div>
			</div>
									<div class="form-group">
			   	<div class="col-sm-2 control-label">估算调整日期</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control" v-model="cPBase.pBChangetime" placeholder="估算调整日期"/>
			    </div>
			</div>
									<div class="form-group">
			   	<div class="col-sm-2 control-label">数据状态</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control" v-model="cPBase.pBDatastate" placeholder="数据状态"/>
			    </div>
			</div>
									<div class="form-group">
			   	<div class="col-sm-2 control-label">是否作图</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control" v-model="cPBase.isDraw" placeholder="是否作图"/>
			    </div>
			</div>
							<div class="form-group">
				<div class="col-sm-2 control-label"></div> 
				<input type="button" class="btn btn-primary" @click="saveOrUpdate" value="确定"/>
				&nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
			</div>
		</form>-->
	</div>
	<!--<div class="new_mainpanle" style="overflow:auto">
		<div class="" id="parent_svg" style="height:1000px; ">
			<svg id="singleLine" width="1000" height="400" version="1.1"
				 xmlns="http://www.w3.org/2000/svg">
			</svg>
		</div>
	</div>-->
</div>

<!--<form id="dxfform" target="_blank" action="/csg/cpbase/expDxfFile" method="post">-->
	<!--<input type="hidden" name="svgStr" id="svgStr">-->
	<!--<input type="hidden" name="dxf_file_name" id="dxf_file_name">-->
<!--</form>-->

<!--<script type="text/javascript">
    //初始化地图对象，加载地图

</script>-->
<script src="../../js/modules/csg/cpbase.js"></script>

<script>
    /*var stage_id;
    //获初始化加载
    function init_load(){
        svg_init();
        getExploration_711();//获取点位
    }

    function expDxf(){

        var projectName = $("#choose_project").html();

        if(projectName == ""){
            tip("请先选择项目！");
            return;
        }

        var regionName = $("#choose_SonProject").find("option:selected").text(); //子项目名称
        var regionNameVal = $("#choose_SonProject").val();

        if(!regionNameVal){
            regionName = "全部";
        }

        var _name = projectName+"_"+regionName;//导出名称：项目名称+子项目名称

        $("#svgStr").val($("#parent_svg").html().replace(/[\r\n]/g,""));
        $("#dxf_file_name").val(_name);
        $("#dxfform").submit();
    }

    function isExsitPro(){
        if("${stage_id}"){
            $.getJSON("lineDesignController.do?projectExistCookie", {
                stageId: "${stage_id}",
                no_current_schedule:1//不加入进度条件
            }, function(data){
                if(data == 1){
                    stage_id = "${stage_id}";
                    $("#choose_project").html("${project_name}");

                    $.get("lineDesignController.do?getSonProjectByStageId", {stageId: stage_id}, function (data) {
                        if (data) {
                            $("#choose_SonProject").empty();
                            var h = "<option value=''>---全部---</option>";
                            for (var i = 0; i < data.length; i++) {
                                h += "<option value='" + data[i]['regionName'] + "'>" + data[i]['region_name'] + "</option>"
                            }
                            $("#choose_SonProject").append(h);
                            init_load();
                        }
                    }, "json");

                }else{
                    chooseProject();
                }
            });
        }else{
            chooseProject();
        }
    }

    //获取点位
    var svgData;

    function getExploration_711(){
        if(stage_id!=undefined){
            var regionName = null;
            if(! $("#choose_SonProject").val())
                regionName = $("#choose_SonProject option:selected").val();
            else
                regionName = $("#choose_SonProject option:selected").text();

            var voltage_grade = $("#voltage_grade").val();

            $.post("projectResultsController.do?getSonProjectExploration", {
                stageId: stage_id,
                regionName:regionName,
                voltage_grade:voltage_grade
            }, function(data){
                svgData = data.svgData;

                svgSpec=data.desc;
                textsjdw=data.textsjdw;
                textgcmc=data.textgcmc;
                projectName=data.projectName;
                stageName=data.stageName;
                load_svg_data();
                millerXY();
            }, "json");
        }else{
            tip('请选择项目');
        }
    }

    var svg;
    $(function(){
        stage_id = "${stage_id}";
        name = "${name}";
        $("#choose_project").html(name);
        svg = Snap("#singleLine");

        $("#choose_SonProject").change(function(){
            init_load();
        });

        $("#searchExploration").click(function(){
            init_load();
        });
        $("#expDxf").click(function(){
            expDxf();
        });
        //放大
        $("#enlarge").click(function(){
            svg_enlarge();
        });
        //缩小
        $("#reduction").click(function(){
            svg_narrow();
        });
        isExsitPro();
    });*/
</script>
</body>
</html>